package cn.iocoder.yudao.module.api.pay.order.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * 支付单创建 DTO
 */
@Data
public class PayOrderCreateDTO implements Serializable {

    public static final int SUBJECT_MAX_LENGTH = 32;
    public static final int BODY_MAX_LENGTH = 128;

    @Schema(description = "商户交易单号", example = "PRD202406271105343545")
    @NotBlank(message = "商户交易单号不能为空")
    private String tradeNo;

    @Schema(description = "商品标题", example = "芋道，让支付触手可及")
    @NotBlank(message = "商品标题不能为空")
    @Length(max = SUBJECT_MAX_LENGTH, message = "商品标题不能超过 32")
    private String subject;

    @Schema(description = "商品描述信息", example = "芋道，让支付触手可及")
    @NotBlank(message = "商品描述信息不能为空")
    @Length(max = BODY_MAX_LENGTH, message = "商品描述信息长度不能超过128")
    private String body;

    @Schema(description = "支付金额，单位：分", example = "100")
    @NotNull(message = "支付金额不能为空")
    @DecimalMin(value = "0", message = "支付金额必须大于等于零")
    private Integer price;

}
